<template>
  <!--模板-->
  <h1>props 的 修饰符</h1>
  {{ props }}
</template>


<script setup lang="ts" generic="T extends {name: string}">
  import { reactive } from 'vue'
  const props = defineProps({
    name: String,
    nameModifiers: { default: () => ({}) }
  })

  const emit = defineEmits(['update:modelValue'])

  console.log('props.nameModifiers::', props.nameModifiers)

  function emitValue(e) {
    let value = e.target.value
    if (props.nameModifiers.capitalize) {
      value = value.charAt(0).toUpperCase() + value.slice(1)
    }
    emit('update:modelValue', value)
  }
</script>